// 用户相关请求模块
import request from '@/utils/request'

export const getQueryCourses = (data:any) => {
  return request({
    method: 'POST',
    url: '/front/course/getQueryCourses',
    data: data
  })
}

export const changeState = (data:any) => {
  return request({
    method: 'GET',
    url: '/boss/course/changeState',
    params: data
  })
}

export const getCourseById = (data:any) => {
  return request({
    method: 'GET',
    url: '/boss/course/getCourseById',
    params: data
  })
}

export const saveOrUpdateCourse = (data:any) => {
  return request({
    method: 'POST',
    url: '/boss/course/saveOrUpdateCourse',
    data
  })
}

export const saveOrUpdateSection = (data:any) => {
  return request({
    method: 'POST',
    url: '/boss/course/section/saveOrUpdateSection',
    data
  })
}

export const saveOrUpdate = (data:any) => {
  return request({
    method: 'POST',
    url: '/boss/course/lesson/saveOrUpdate',
    data
  })
}

export const upload = (data:any) => {
  return request({
    method: 'POST',
    url: '/boss/course/upload',
    data
  })
}

export const getSectionAndLesson = (courseId:string|number) => {
  return request({
    method: 'GET',
    url: '/boss/course/section/getSectionAndLesson',
    params: {
      courseId
    }
  })
}

export const getBySectionId = (sectionId:string|number) => {
  return request({
    method: 'GET',
    url: '/boss/course/section/getBySectionId',
    params: {
      sectionId
    }
  })
}
